//分类
import Category from "../views/Category.vue";

//分类子路由
import Recommend from '../views/category/recommend.vue'
import Bedding from '../views/category/Bedding.vue'
import ShoeBag from '../views/category/ShoeBag.vue'
import Snack from '../views/category/Snack.vue'
import Cleaning from '../views/category/Cleaning.vue'
import MotherChild from '../views/category/MotherChild.vue'
import SportsTravel from '../views/category/SportsTravel.vue'
import DigitalHousehold from '../views/category/DigitalHousehold.vue'
import PetLife from '../views/category/PetLife.vue'

//购物车
import Cart from "../views/Cart.vue";
//个人中心
import Center from "../views/Center.vue";

import { RouterView } from 'vue-router'

import CartDetails from '../views/CartDetails.vue'
import GoodsList from '../views/GoodsList.vue'


const Content = {
    render: h => h(RouterView)
};

export default [
    {
        path: '',
        redirect: "/category", //重定向
    },
    {
        path: "category",
        component: Category,
        meta: {
            title: "category",
        },
        children: [
            {
                path: "",
                //重定向：完整的url地址
                redirect: "/category/recommend",
            },
            // 为你推荐
            {
                path: "recommend",
                component: Recommend,
                name: "b1",
            },

            // 床品床垫
            {
                path: "Bedding",
                component: Bedding,
                name: "b2",
            },

            // 鞋包配饰
            {
                path: "ShoeBag",
                component: ShoeBag,
                name: "b3",
            },

            // 休闲零食
            {
                path: "Snack",
                component: Snack,
                name: "b4",
            },

            // 家庭清洁
            {
                path: "Cleaning",
                component: Cleaning,
                name: "b5",
            },

            // 母婴亲子
            {
                path: "MotherChild",
                component: MotherChild,
                name: "b6",
            },

            // 运动旅行
            {
                path: "SportsTravel",
                component: SportsTravel,
                name: "b7",
            },
            // 数码家电
            {
                path: "DigitalHousehold",
                component: DigitalHousehold,
                name: "b8",
            },
            // 宠物生活
            {
                path: "PetLife",
                component: PetLife,
                name: "b9",
            },


            // 为你推荐-列表页
            {
                path: 'recommend/:id/:subCategoryId',
                name: 'b1-detail',
                component: GoodsList
            },
            // 床品床垫-列表页
            {
                path: 'Bedding/:id/:subCategoryId',
                name: 'b2-detail',
                component: GoodsList
            },
            // 鞋包配饰-列表页
            {
                path: 'ShoeBag/:id/:subCategoryId',
                name: 'b3-detail',
                component: GoodsList
            },
            // 休闲零食-列表页
            {
                path: 'Snack/:id/:subCategoryId',
                name: 'b4-detail',
                component: GoodsList
            },
            // 家庭清洁-列表页
            {
                path: 'Cleaning/:id/:subCategoryId',
                name: 'b5-detail',
                component: GoodsList
            },
            // 母婴亲子-列表页
            {
                path: 'MotherChild/:id/:subCategoryId',
                name: 'b6-detail',
                component: GoodsList
            },
            // 运动旅行-列表页
            {
                path: 'SportsTravel/:id/:subCategoryId',
                name: 'b7-detail',
                component: GoodsList
            },
            // 数码家电-列表页
            {
                path: 'DigitalHousehold/:id/:subCategoryId',
                name: 'b8-detail',
                component: GoodsList
            },
            // 宠物生活-列表页
            {
                path: 'PetLife/:id/:subCategoryId',
                name: 'b9-detail',
                component: GoodsList
            },


            //详情页
            {
                path: 'GoodsList/:id/',
                name: 'c1-detail',
                component: CartDetails
            },
            // 床品床垫-详情页
            // {
            //     path: 'Bedding/:id/',
            //     name: 'c1-detail',
            //     component: CartDetails
            // },
            // // 鞋包配饰-详情页
            // {
            //     path: 'ShoeBag/:id/',
            //     name: 'c1-detail',
            //     component: CartDetails
            // },
            // // 休闲零食-详情页
            // {
            //     path: 'Snack/:id/',
            //     name: 'c1-detail',
            //     component: CartDetails
            // },
            // // 家庭清洁-详情页
            // {
            //     path: 'Cleaning/:id/',
            //     name: 'c1-detail',
            //     component: CartDetails
            // },
            // // 母婴亲子-详情页
            // {
            //     path: 'MotherChild/:id/',
            //     name: 'c1-detail',
            //     component: CartDetails
            // },
            // // 运动旅行-详情页
            // {
            //     path: 'SportsTravel/:id/',
            //     name: 'c1-detail',
            //     component: CartDetails
            // },
            // // 数码家电-详情页
            // {
            //     path: 'DigitalHousehold/:id/',
            //     name: 'c1-detail',
            //     component: CartDetails
            // },
            // // 宠物生活-详情页
            // {
            //     path: 'PetLife/:id/',
            //     name: 'c1-detail',
            //     component: CartDetails
            // },
        ],
    },
    {
        path: "cart",
        component: Cart,
    },
    {
        path: "center",
        component: Center,
    },
];
